import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WithdrawalQuery, WithdrawalPageResult } from './types';

export function getWithdrawalList(queryParams?: WithdrawalQuery): AxiosPromise<WithdrawalPageResult[]> {
  return request({
    url: '/web/casualWithdrawalReview/pages',
    method: 'get',
    params: queryParams,
  });
}

export function withdrawalAdopt(params: any) {
  return request({
    url: '/web/casualWithdrawalReview/withdrawalAdopt',
    method: 'get',
    params: params
  });
}
export function withdrawalLose(params: any) {
  return request({
    url: '/web/casualWithdrawalReview/withdrawalLose',
    method: 'get',
    params: params
  });
}

/**
 * 导出用户
 *
 * @param queryParams
 * @returns
 */
export function exportReport(queryParams: any) {
  return request({
    url: '/web/casualWithdrawalReview/exportReport',
    method: 'get',
    params: queryParams,
    responseType: 'arraybuffer',
  });
}

// 工程师统计
export function engineerStatistics(id: any) {
  return request({
    url: '/web/casualEngineer/engineerStatistics/' + id,
    method: 'get',
  });
}

/**
 * 工程师订单导出
 *
 * @param queryParams
 * @returns
 */
export function engineerOrderExport(queryParams: any) {
  return request({
    url: '/web/casualWithdrawalReview/engineerOrderExport',
    method: 'get',
    params: queryParams,
    responseType: 'arraybuffer',
  });
}
